/* $Id: AndWithoutExecutableContext.h 27 2011-09-16 13:28:08Z skagget77 $ */

/*!
 * \file
 * \author  Johan Andersson <skagget77@gmail.com>
 * \date    Mon Feb 15 20:59 2010
 * \ingroup IoCpp
 * \brief   IoCpp Scanner EDSL.
 */

#if !defined(IOCPP_ANDWITHOUTEXECUTABLECONTEXT_H)
#define IOCPP_ANDWITHOUTEXECUTABLECONTEXT_H

#include "ScanContext.h"

namespace IoCpp
{
   /*!
    * \author  Johan Andersson <skagget77@gmail.com>
    * \date    Mon Feb 15 20:59 2010
    * \ingroup IoCpp
    * \sa      Scanner for information on how to use IoCpp Scanner EDSL.
    * \brief   The AndWithoutExecutableContext class, part of IoCpp Scanner EDSL.
    *
    * \details This class should only be used indirectly through the Scanner
    *          class which is the entry point to the Scanner EDSL.
    */
   class AndWithoutExecutableContext
   {
   public :
      /*!
       * Creates a new instance of the AndWithoutExecutableContext class.
       *
       * \param context the ScanContext holding the EDSL state.
       */
      AndWithoutExecutableContext( ScanContextPtr context )
         : mContext(context) {
      }

      /*!
       * Selects an additional library to scan.
       *
       * \param  library the library to scan.
       * \return This AndWithoutExecutableContext.
       */
      AndWithoutExecutableContext AndLibrary( const FileCollection::value_type& library ) const
      {
         mContext->AddLibrary(library, false);
         return *this;
      }

      /*!
       * Selects an additional optional library to scan.
       *
       * \param  library the library to scan.
       * \return This AndWithoutExecutableContext.
       */
      AndWithoutExecutableContext AndOptionalLibrary( const FileCollection::value_type& library ) const
      {
         mContext->AddLibrary(library, true);
         return *this;
      }

      /*!
       * Selects an additional path to scan.
       *
       * \param  path the path to scan.
       * \return This AndWithoutExecutableContext.
       */
      AndWithoutExecutableContext AndPath( const PathCollection::value_type& path ) const 
      {
         mContext->AddPath(path, false);
         return *this;
      }

      /*!
       * Selects an additional optional path to scan.
       *
       * \param  path the path to scan.
       * \return This AndWithoutExecutableContext.
       */
      AndWithoutExecutableContext AndOptionalPath( const PathCollection::value_type& path ) const 
      {
         mContext->AddPath(path, true);
         return *this;
      }

   private :
      ScanContextPtr mContext;
   };
}

#endif   // IOCPP_ANDWITHOUTEXECUTABLECONTEXT_H
